package org.csu.jpetstorespringversion.service.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.csu.jpetstorespringversion.mapper.OrderstatusMapper;
import org.csu.jpetstorespringversion.model.Order;
import org.csu.jpetstorespringversion.model.Orderstatus;
import org.csu.jpetstorespringversion.service.OrderstatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderstatusServiceImpl extends ServiceImpl<OrderstatusMapper, Orderstatus> implements OrderstatusService {
     @Autowired
    OrderstatusMapper orderstatusMapper;
     @Autowired
     Orderstatus orderstatus;

    @Override
    public void insertOrderstatus(Order order) {

        orderstatus.setOrderId(order.getOrderId());
        orderstatus.setLineNum(order.getOrderId());
        orderstatus.setTimeStamp(order.getOrderDate());
        orderstatus.setStatus(order.getStatus());
        int insertOrderstatus =orderstatusMapper.insert(orderstatus);
        System.out.println("insertOrderstatus="+insertOrderstatus);

    }
}
